package com.example.tourism.pojo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.ResponseBody;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result<T> {
    private  Integer  code;
    private  String  message;
    private  T data;

    public static <E> Result<E> success(E data){
        return new Result<>(200,"success",data);
    }

    public static Result success(){
        return new Result(200,"success",null);
    }
    public static <E> Result<E> error(Integer code,String message){
        return new Result<>(code,message,null);
    }

}
